<template>
	<view>
		<u-navbar title="技师入驻" :autoBack="true" bgColor="#fff" :fixed="false"></u-navbar>
		<u-notice-bar :text="text1"></u-notice-bar>
		<view class="p-30">
			<u-upload accept="media" :capture="['camera']" :fileList="fileList1" @afterRead="afterRead"
				@delete="deletePic" name="1" multiple :maxCount="1" width="690rpx" height="600rpx">
				<view class="box mb-30 flex-column align-center justify-center">
					<image :src="video" mode="widthFix" style="width: 200rpx;height: 200rpx;"></image>
					<view class="mt-30" style="color: #fff;">
						点击开始录制视频
					</view>
				</view>
			</u-upload>

			<u-alert :title="title" type="error" :description="description"></u-alert>
		</view>
		<view class="submit">
			<u-button shape="circle" text="取消" :customStyle="{'width':'48%'}" @click="quxiao"></u-button>
			<u-button @click="submit" :color="$u.color.color" shape="circle" text="下一步"
				:customStyle="{'width':'48%'}"></u-button>
		</view>

		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import commonMixin from '@/mixins/common.js';
	import img from '@/mixins/img.js';
	export default {
		mixins: [commonMixin, img],
		data() {
			return {
				fileList1: [],
				text1: '*录制的视频不会对外公开，若涉嫌欺诈平台将予以追究',
				title: '',
				description: '温馨提示：淡妆出境，展示一下身材，会获得平台小编较高的颜值评分哦~',
				attachfile: ""
			}
		},
		methods: {
			submit() {
				let vm = this;
				if (this.fileList1.length == 0) {
					vm.$refs.uToast.show({
						type: 'error',
						message: '请录制视频',
						complete() {

						}
					})
					return false;
				}
				this.attachfile = this.fileList1[0]['url']
				uni.redirectTo({
					url: '/pages/settle/form?attachfile=' + this.attachfile
				})
			},
			quxiao() {
				uni.redirectTo({
					url: '/pages/settle/index'
				})
			}
		}
	}
</script>

<style>
	.box {
		background-color: #999;
		width: 690rpx;
		height: 600rpx;
		border-radius: 10rpx;
	}

	.submit {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		background-color: #fff;
		padding: 30rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
</style>